/**
 * Created by yoyoyk on 2017/6/27.
 */
import Relay from "react-relay";
import GetQiNiuToken from "./mutation/GetQiNiuToken"  //上传图片获取token

export default function getQiniuToken(callback){
    // 获取上传图片所需的token
    Relay.Store.commitUpdate(
        new GetQiNiuToken({}), {
            onSuccess: (res) => {
                let data = res.getQiNiuToken.getQiNiuToken;
                callback(data);
            },
            onFailure: ()=>{
                new Error("get QiNiuToken error")
            }
        }
    );
}
